import $http from '@/common/api/request'

// 查询车辆详情
export function getCarDetail(id, data) {
  return $http.get('/vehicle/auto/' + id, data)
}

// 查询车型
export function getCarType(userId, data) {
  return $http.get('/product/vehicleType/user/' + userId, data)
}

// 查看
export function getExpense(id) {
  return $http.get('/vehicle/portal/vehicle/repair/plan/details/' + id)
}

// 添加车辆信息
export function addCarInfo(data) {
  return $http.post('/vehicle/auto/add', data, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 修改车辆信息
export function updateCarInfo(id, data) {
  return $http.post('/vehicle/auto/update/' + id, data, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 车辆提交审核
export function submitReviewCar(data) {
  return $http.post('/vehicle/auto/review/submit', data, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 查询订单列表【车企】
export function getCompanyOrder(data) {
  return $http.get('/order/portal/order/page', data)
}

// 编辑车辆维修计划
export function getRepair(data) {
  return $http.get('/vehicle/portal/vehicle/repair/plan/listPage', data)
}

// 编辑车辆维修计划
export function editRepairState(obj) {
  return $http.put('/vehicle/portal/vehicle/repair/plan', obj, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function editRepair(obj) {
  return $http.put('/vehicle/portal/vehicle/repair/plan/v1', obj, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 添加车辆维修计划
// export function addRepair(data) {
//   return $http.post('/vehicle/portal/vehicle/repair/plan', data, {
//     header: {
//       'Content-Type': 'application/json;charset=UTF-8'
//     }
//   })
// }

export function addRepair(data) {
  return $http.post('/vehicle/portal/vehicle/repair/plan/v1', data, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 删除车型定价或产品定价
export function deletePrice(priceId, data) {
  return $http.post('/product/price/delete/' + priceId, data)
}

// 新增车型定价或产品定价
export function addPrice(data) {
  return $http.post('/product/price/add', data)
}

// 修改车型定价或产品定价
export function updatePrice(data) {
  return $http.post('/product/price/update', data)
}

// 设定超公里价格
export function updateOverMileagePrice(data) {
  return $http.post('/product/price/overMileage/addOrUpdate', data, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 批量设置产品定价
export function updateAllProductsPrice(data) {
  return $http.post('/product/price/batchSetForProduct', data, {
    header: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 获取系统内置车型
export function getAdminVehicleTypePage(data) {
  return $http.get('/vehicle/portal/vehicle/type/getAdminVehicleTypePage', data)
}

// 获取平台价格限制
export function getPlatformOverPriceLimit(data) {
  return $http.get('/vehicle/portal/platformSeatPriceOver/get/platformOverPriceLimit', data)
}

